#!/usr/bin/env python
#-*- coding: utf-8 -*-
'''模块名
@version: $Id$
@author: U{xuw zhan <zhanxuw#gmail.com>}
@license: LGPL
@see: 参考资料链接等等
'''
import sys
from PyQt4 import QtGui

class Center(QtGui.QWidget):
    def __init__(self,parent=None):
        QtGui.QWidget.__init__(self,parent)

        self.setWindowTitle('Center')
        self.resize(250,150)
        self.center()

    def center(self):
        screen=QtGui.QDesktopWidget().screenGeometry()
        size=self.geometry()
        self.move((screen.width()-size.width())/2,
                (screen.height()-size.height())/2)


def main():
    '''
主函数
- 命令行测试
@todo: 计划完成...
    '''
    app=QtGui.QApplication(sys.argv)
    qb=Center()
    qb.show()
    sys.exit(app.exec_())

if __name__ == "__main__":
    main()

